package com.haiyi.activiti.engine.framework.template.object;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * <p> 一些全局的配置，配置在数据库中 </p>
 *
 * <pre> Created: 2018/12/10 13:23 </pre>
 *
 * @author hlu
 * @version 1.0
 * @since JDK 1.7
 */
@Component
public class TemplateConfiguration {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public String getProperty(String key) {
        final Object value = jdbcTemplate.queryForMap("select VALUE from WF_PROPERTY where key = ?", key).get("value");
        return (String) value;
    }

}
